package com.zn.service;

import com.zn.entity.FutureReportOrder;
import com.zn.vo.Message;
import com.zn.web.dto.FuturesTradeDto;
import com.zn.web.dto.OptionTradeDto;
import org.springframework.http.ResponseEntity;

import java.util.List;

/**
 * @author YinJiaWei
 * @version 2018/10/29 13:29
 */
public interface OptionTradeService {
    /**
     * 校验买入卖出
     * @param optionTradeDto
     * @return
     */
    ResponseEntity<Message> checkBuyAndSell(OptionTradeDto optionTradeDto);

    /**
     * 开仓报单请求
     * @param optionTradeDto
     * @return
     */
    public ResponseEntity<Message> reqsOpenReportOrder(OptionTradeDto optionTradeDto) throws Exception;

    /**
     * 平仓报单请求
     * @param optionTradeDto
     * @return
     */
    public ResponseEntity<Message> reqsCloseReportOrder(OptionTradeDto optionTradeDto) throws Exception;

    /**
     * 撤单请求
     * @param optionTradeDto
     * @return
     * @throws Exception
     */
    public ResponseEntity<Message> reqsCancelReportOrder(OptionTradeDto optionTradeDto) throws Exception;

    /**
     * 报单响应
     * @param msg 来自c++的报单响应
     * @return
     */
    public ResponseEntity<Message> respReportOrder(String msg) throws Exception;

    /**
     * 成交响应
     * @param msg 来自c++的成交响应
     * @return
     * @throws Exception
     */
    public ResponseEntity<Message> respDealOrder(String msg) throws  Exception;

    /**
     * 推送委托或成交信息给客户端
     * @param customerId
     * @param type
     * @param data
     */
    public void sendNotifyChannel(String customerId,Integer type,Object data);

    /**
     * 推送订单信息toCrm
     * @param orderId
     * @param orderType
     */
    public void sendDealOrderToCrm(String orderId,String orderType);
    /**
     * 将客户的持仓单传给c++
     */
    public void sendPositionOrder();

    /**
     * 获取 持仓/委托/平仓列表
     * @param optionTradeDto
     * @return
     */
    public List<?> getOrderList(OptionTradeDto optionTradeDto);

    /**
     * 风控强平
     * @param instrumentCode
     */
    public void riskManagementClose(String instrumentCode,Double limitPrice);

    /**
     * 对冲单报单请求
     * @param optionTradeDto
     * @return
     */
    public ResponseEntity<Message> reqsHedgingReportOrder(OptionTradeDto optionTradeDto) throws Exception;

    /**
     * 报单响应
     * @param msg 来自c++的报单响应
     * @return
     */
    public ResponseEntity<Message> respHedgingReportOrder(String msg) throws Exception;

    /**
     * 对冲单成交响应
     * @param msg 来自c++的成交响应
     * @return
     * @throws Exception
     */
    public ResponseEntity<Message> respHedgingDealOrder(String msg) throws  Exception;

}
